import Vue from "vue";
import VueRouter from "vue-router";
import HmLogon from "@/views/HmLogon.vue";
import HmHmoe from "@/views/HmHome.vue";
import HmRegister from "@/views/HmRegister.vue";
import HmMy from "@/views/HmMy.vue";
import HmCollect from "@/views/HmCollect.vue";
import HmThumbs from "@/views/HmThumbs-up.vue";
import HmViews from "@/views/HmViews.vue";
import HmRecommend from "@/views/HmRecommend.vue";
import HmUpToDate from "@/views/HmUpToDate.vue";
import HmDetail from "@/views/HmDetail.vue";

Vue.use(VueRouter);
const router = new VueRouter({
  linkActiveClass: "active",
  linkExactActiveClass: "exactive",
  routes: [
    { path: "/", redirect: "/logon" },
    { path: "/detail", component: HmDetail },
    { path: "/logon", component: HmLogon },
    { path: "/register", component: HmRegister },

    {
      path: "/home",
      component: HmHmoe,
      children: [
        { path: "/home/my", component: HmMy },
        { path: "/home/up", component: HmThumbs },
        { path: "/home/collect", component: HmCollect },
        {
          path: "/home/views",
          component: HmViews,
          children: [
            { path: "/", redirect: "/home/views/recommend" },
            { path: "/home/views/recommend", component: HmRecommend },
            { path: "/home/views/thumbsup", component: HmUpToDate },
          ],
        },
      ],
    },
  ],
});

export default router;
